package com.xinchao.ck_mips.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.xinchao.ck_mips.constant.CK;

/**
 * Created by wq
 */

public class DaoHelper {
    private static DaoMaster.DevOpenHelper mHelper;
    private static SQLiteDatabase db;
    private static DaoMaster mDaoMaster;
    private static DaoSession mDaoSession;

    public static void initDatabase(Context mContext) {
        mHelper = new DaoMaster.DevOpenHelper(mContext, CK.DB_NAME, null);
        db = mHelper.getWritableDatabase();
        mDaoMaster = new DaoMaster(db);
        mDaoSession = mDaoMaster.newSession();
    }

    public static DaoSession getDaoSession() {
        return mDaoSession;
    }

    public static SQLiteDatabase getDB() {
        return db;
    }
}
